#include "networkpostjsonrequest.h"
#include "networkjsonresponse.h"
#include <json.h>

using namespace Network;

PostJsonRequest::PostJsonRequest(QObject *parent) :
    PostRequest(parent)
{
}

Response &PostJsonRequest::response()
{
    return jsonResponse();
}

const Response &PostJsonRequest::response() const
{
    return jsonResponse();
}

QByteArray PostJsonRequest::data() const
{
    JsonWriter writer;
    return writer.toString(json()).toUtf8();
}

QString PostJsonRequest::format() const
{
    return QString("text/plain");
}
